home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11218 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.6 KB

  1. Path: soap.news.pipex.net!pipex!usenet
  2. From: John Nurick <j.nurick@dial.pipex.com>
  3. Newsgroups: comp.lang.pascal.delphi.misc,comp.lang.c,comp.lang.pascal.misc,comp.lang.c++
  4. Subject: Re: WORD FILE FORMAT (WINDOWS)
  5. Date: 13 Mar 1996 07:49:27 GMT
  6. Organization: UnipalmPIPEX server (post doesn't reflect views of UnipalmPIPEX)
  7. Message-ID: <4i5um7$7vi@soap.news.pipex.net>
  8. References: <4hv2ho$d8t@news.interpath.net> <4i2c5e$t70@kiwi.futuris.net> <4i4rb1$snv@gate.stateoftheart.com>
  9. NNTP-Posting-Host: an051.du.pipex.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
  14.  
  15. Mike Girou (girou@parashift.com) wrote:
  16. >Once [Microsoft] publish the internal [Winword file format]
  17. >standards, then they are pretty well stuck with that standard for
  18. >life.  As long as they, and only they, build code around the internal
  19. >representations, they are free to change those representations as the
  20. >need arises (hopefully providing conversion tools).  
  21.  
  22. Just like OOP!
  23.  
  24.  
  25. gt2497b@acmez.gatech.edu (Joe Novosel) wrote
  26.  
  27. >Their own programs are not even compatable
  28. >with themselves.  I use Word v6 and v2.  I have to use v2 on my notebook
  29. >because 6.0 is so big.  I have to be very careful file formats because 2.0
  30. >won't read 6.0's files.  
  31.  
  32. There's a Microsoft filter for Word 2 that reads Word 6 files; 
  33. can't remember the name but I think you can ftp it from microsoft.com. 
  34. Still doesn't support the nice new formatting features in WW6 of
  35. course ... 
  36.  
  37.  
  38. WinWord 6 file format:
  39.  
  40. WinWord 6+ and some or all of the rest of MS Office use OLE Structured 
  41. Storage for their files. This means each file has an internal tree 
  42. structure of _storages_ and _streams_, analogous to directories & files. 
  43. It gives a standard interface for storage of OLE objects, and for other 
  44. apps to extract information (e.g. summary info). It is also why WW6 files 
  45. are so much bigger than earlier Word versions'.
  46.  
  47. There's a Delphi-centred intro to OLE SS by John Lam in PC Magazine
  48. (US) 19 December 95, though it doesn't cover WW6 as such. Another
  49. contributor to this thread mentioned discussion of WW6 files in PC
  50. Mag; like him/her I recollect it but can't find it.
  51.  
  52. Word tradition from way back has been to store the text as straight
  53. text with no formatting instructions or tags. All the formatting 
  54. is in separate tables or lists at the end. This made it pretty easy
  55. to extract plain text from a not-too-complicated Word doc: the text
  56. began immediately after the file header, and the header contained a
  57. pointer to the first byte of the formatting tables.
  58.  
  59. The same basic approach should work with WW6, although you'd have
  60. to delve into OLE SS to get the offsets of the start and end of text.
  61.  
  62. With complicated texts (footnotes, annotations, symbols, tables, 
  63. fields), however, things rapidly get a lot nastier. 
  64.  
  65. Footnotes have always been indicated by a single non-printing char 
  66. in the text (same char for every footnote); the program had 
  67. to keep track of these and maintain pointers to the text of each 
  68. note. From WW6, the same technique is used for symbols (e.g. a single
  69. char from WingDings or Symbol font) (which is why searching for a
  70. symbol in WW6 doesn't work properly!).
  71.  
  72. IMHO the least worst approach to the problem this thread started 
  73. with would be to use WordBasic to export the relevant files as text 
  74. or .RTF and distribute them in that form. No big challenge to write 
  75. a WordBasic program to look out for changes (SaveDate) in the docs 
  76. and update the text or RTF versions (or you can do it with Delphi 
  77. and the WordBasic API).
  78.  
  79.  
  80. -- 
  81. Best wishes
  82.  
  83. John Nurick
  84.  
  85. e-mail: j.nurick@dial.pipex.com 
  86. v-mail: <+44|0> 191 281 1306
  87.  
  88.  
  89.